﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 类似勒索
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string oldpwd = Properties.Settings.Default.Pwd;

            if(txtoldPwd.Text.Trim()=="")
            {
                MessageBox.Show("请输入旧口令！");
                return;
            }

            if(txtnewPwd.Text.Trim()=="")
            {
                MessageBox.Show("请输入新口令！");
                return;
            }

            if (txtnewPwd.Text.Trim() != txtnewPwdR.Text.Trim())
            {
                MessageBox.Show("新口令与重复口令不一致！");
                return;
            }

            Properties.Settings.Default.Pwd = txtnewPwd.Text.Trim();
            Properties.Settings.Default.Save();

            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
